<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Global - Documentation</title>

    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Tutorials</h3><ul><li><a href="tutorial-closest.html">closest</a></li><li><a href="tutorial-distance-length.html">distance-length</a></li></ul><h3>Global</h3><ul><li><a href="global.html#accumulatedLengths">accumulatedLengths</a></li><li><a href="global.html#bearing">bearing</a></li><li><a href="global.html#belongsSegment">belongsSegment</a></li><li><a href="global.html#closest">closest</a></li><li><a href="global.html#closestLayer">closestLayer</a></li><li><a href="global.html#closestLayerSnap">closestLayerSnap</a></li><li><a href="global.html#closestOnSegment">closestOnSegment</a></li><li><a href="global.html#computeAngle">computeAngle</a></li><li><a href="global.html#computeSlope">computeSlope</a></li><li><a href="global.html#destination">destination</a></li><li><a href="global.html#distance">distance</a></li><li><a href="global.html#distanceSegment">distanceSegment</a></li><li><a href="global.html#extract">extract</a></li><li><a href="global.html#interpolateOnLine">interpolateOnLine</a></li><li><a href="global.html#interpolateOnPointSegment">interpolateOnPointSegment</a></li><li><a href="global.html#isAfter">isAfter</a></li><li><a href="global.html#isBefore">isBefore</a></li><li><a href="global.html#layersWithin">layersWithin</a></li><li><a href="global.html#length">length</a></li><li><a href="global.html#locateOnLine">locateOnLine</a></li><li><a href="global.html#nClosestLayers">nClosestLayers</a></li><li><a href="global.html#readableDistance">readableDistance</a></li><li><a href="global.html#reverse">reverse</a></li><li><a href="global.html#rotatePoint">rotatePoint</a></li><li><a href="global.html#startsAtExtremity">startsAtExtremity</a></li></ul>
</nav>

<div id="main">
    
    <h1 class="page-title">Global</h1>
    

    




<section>

<header>
    
        <h2>
        
        </h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

        


<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>


        
    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="accumulatedLengths"><span class="type-signature"></span>accumulatedLengths<span class="signature">(coords)</span><span class="type-signature"> &rarr; {Array.&lt;Number>}</span></h4>

    



<div class="description">
    <p>Returns a list of accumulated length along a line.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>coords</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Polyline</span>
|

<span class="param-type">Array.&lt;L.Point></span>
|

<span class="param-type">Array.&lt;L.LatLng></span>


            
            </td>

            

            

            <td class="description last"><p>Set of coordinates</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line123">line 123</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Array of accumulated lengths (pixels for Point, meters for LatLng)</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;Number></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="bearing"><span class="type-signature"></span>bearing<span class="signature">(latlng1:, latlng2:)</span><span class="type-signature"> &rarr; {float}</span></h4>

    



<div class="description">
    <p>Returns the bearing in degrees clockwise from north (0 degrees)
       from the first L.LatLng to the second, at the first LatLng</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlng1:</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>origin point of the bearing</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng2:</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>destination point of the bearing</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line688">line 688</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>degrees clockwise from north.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">float</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="belongsSegment"><span class="type-signature"></span>belongsSegment<span class="signature">(latlng, latlngA, latlngB, tolerance<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    <p>Returns true if the latlng belongs to segment A-B</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>geographical point A of the segment</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>geographical point B of the segment</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>tolerance</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    0.2
                
                </td>
            

            <td class="description last"><p>tolerance to accept if latlng belongs really</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line99">line 99</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="closest"><span class="type-signature"></span>closest<span class="signature">(map, layer, latlng, vertices<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {L.LatLng}</span></h4>

    



<div class="description">
    <p>Returns the closest latlng on layer.</p>
<pre class="prettyprint source"><code>    Accept nested arrays</code></pre>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layer</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;L.LatLng></span>
|

<span class="param-type">Array.&lt;Array.&lt;L.LatLng>></span>
|

<span class="param-type">L.PolyLine</span>
|

<span class="param-type">L.Polygon</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Layer that contains the result</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>vertices</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>Whether to restrict to path vertices.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line173">line 173</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Closest geographical point or null if layer param is incorrect</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">L.LatLng</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="closestLayer"><span class="type-signature"></span>closestLayer<span class="signature">(map, layers, latlng)</span><span class="type-signature"> &rarr; {object}</span></h4>

    



<div class="description">
    <p>Returns the closest layer to latlng among a list of layers.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;L.ILayer></span>


            
            </td>

            

            

            <td class="description last"><p>Set of layers</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line281">line 281</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p><code>{layer, latlng, distance}</code> or <code>null</code> if list is empty;</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">object</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="closestLayerSnap"><span class="type-signature"></span>closestLayerSnap<span class="signature">(map, layers, latlng, tolerance<span class="signature-attributes">opt, nullable</span>, withVertices<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {object}</span></h4>

    



<div class="description">
    <p>Returns the closest position from specified {LatLng} among specified layers,
        with a maximum tolerance in pixels, providing snapping behaviour.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;ILayer></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>A list of layers to snap on.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The position to snap</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>tolerance</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last"><p>Maximum number of pixels.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>withVertices</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last"><p>Snap to layers vertices or segment points (not only vertex)</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line417">line 417</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>with snapped {LatLng} and snapped {Layer} or null if tolerance exceeded.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">object</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="closestOnSegment"><span class="type-signature"></span>closestOnSegment<span class="signature">(map, latlng, latlngA, latlngB)</span><span class="type-signature"> &rarr; {L.LatLng}</span></h4>

    



<div class="description">
    <p>Returns the closest point of a {L.LatLng} on the segment (A-B)</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>geographical point A of the segment</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>geographical point B of the segment</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line149">line 149</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-closest.html">closest</a></li>
        </ul>
    </dd>
    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Closest geographical point</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">L.LatLng</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="computeAngle"><span class="type-signature"></span>computeAngle<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Returns horizontal angle in degres between two points.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>a</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Point</span>


            
            </td>

            

            

            <td class="description last"><p>Coordinates of point A</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>b</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Point</span>


            
            </td>

            

            

            <td class="description last"><p>Coordinates of point B</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line646">line 646</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>horizontal angle</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="computeSlope"><span class="type-signature"></span>computeSlope<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    



<div class="description">
    <p>Returns slope (Ax+B) between two points.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>a</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Point</span>


            
            </td>

            

            

            <td class="description last"><p>Coordinates of point A</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>b</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Point</span>


            
            </td>

            

            

            <td class="description last"><p>Coordinates of point B</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line656">line 656</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>with <code>a</code> and <code>b</code> properties.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="destination"><span class="type-signature"></span>destination<span class="signature">(latlng:, :, :)</span><span class="type-signature"> &rarr; {L.latLng}</span></h4>

    



<div class="description">
    <p>Returns the point that is a distance and heading away from
       the given origin point.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlng:</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>origin point</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>:</code></td>
            

            <td class="type">
            
                
<span class="param-type">float</span>


            
            </td>

            

            

            <td class="description last"><p>heading in degrees, clockwise from 0 degrees north.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>:</code></td>
            

            <td class="type">
            
                
<span class="param-type">float</span>


            
            </td>

            

            

            <td class="description last"><p>distance in meters</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line712">line 712</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>the destination point.
       Many thanks to Chris Veness at http://www.movable-type.co.uk/scripts/latlong.html
       for a great reference and examples.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">L.latLng</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="distance"><span class="type-signature"></span>distance<span class="signature">(map, latlngA, latlngB)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Shortcut function for planar distance between two {L.LatLng} at current zoom.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>geographical point A</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>geographical point B</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line42">line 42</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-distance-length.html">distance-length</a></li>
        </ul>
    </dd>
    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>planar distance</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="distanceSegment"><span class="type-signature"></span>distanceSegment<span class="signature">(map, latlng, latlngA, latlngB)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Shortcut function for planar distance between a {L.LatLng} and a segment (A-B).</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngA</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>geographical point A of the segment</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngB</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>geographical point B of the segment</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line54">line 54</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>planar distance</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="extract"><span class="type-signature"></span>extract<span class="signature">(map, polyline, start, end)</span><span class="type-signature"> &rarr; {Array.&lt;L.LatLng>}</span></h4>

    



<div class="description">
    <p>Returns a sub-part of the polyline, from start to end.
        If start is superior to end, returns extraction from inverted line.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>Polyline on which will be extracted the sub-part</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>start</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>ratio, expressed as a decimal between 0 and 1, inclusive</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>end</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>ratio, expressed as a decimal between 0 and 1, inclusive</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line572">line 572</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>new polyline</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;L.LatLng></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="interpolateOnLine"><span class="type-signature"></span>interpolateOnLine<span class="signature">(map, latlngs, ratio)</span><span class="type-signature"> &rarr; {Object}</span></h4>

    



<div class="description">
    <p>Returns the coordinate of the point located on a line at the specified ratio of the line length.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngs</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;L.LatLng></span>
|

<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>Set of geographical points</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ratio</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>the length ratio, expressed as a decimal between 0 and 1, inclusive</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line458">line 458</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>an object with latLng ({LatLng}) and predecessor ({Number}), the index of the preceding vertex in the Polyline
        (-1 if the interpolated point is the first vertex)</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="interpolateOnPointSegment"><span class="type-signature"></span>interpolateOnPointSegment<span class="signature">(pA, pB, the)</span><span class="type-signature"> &rarr; {L.Point}</span></h4>

    



<div class="description">
    <p>Returns the Point located on a segment at the specified ratio of the segment length.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>pA</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Point</span>


            
            </td>

            

            

            <td class="description last"><p>coordinates of point A</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>pB</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Point</span>


            
            </td>

            

            

            <td class="description last"><p>coordinates of point B</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>the</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>length ratio, expressed as a decimal between 0 and 1, inclusive.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line443">line 443</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>the interpolated point.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">L.Point</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="isAfter"><span class="type-signature"></span>isAfter<span class="signature">(polyline, other)</span><span class="type-signature"> &rarr; {bool}</span></h4>

    



<div class="description">
    <p>Returns true if first polyline starts where second ends.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>First polyline</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>Second polyline</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line619">line 619</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">bool</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="isBefore"><span class="type-signature"></span>isBefore<span class="signature">(polyline, other)</span><span class="type-signature"> &rarr; {bool}</span></h4>

    



<div class="description">
    <p>Returns true if first polyline ends where other second starts.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>First polyline</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>Second polyline</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line606">line 606</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">bool</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="layersWithin"><span class="type-signature"></span>layersWithin<span class="signature">(map, layers, latlng, radius<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {Array.&lt;object>}</span></h4>

    



<div class="description">
    <p>Returns all layers within a radius of the given position, in an ascending order of distance.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;ILayer></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>A list of layers.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>radius</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last"><p>Search radius in pixels</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line373">line 373</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>an array of objects including layer within the radius, closest latlng, and distance</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;object></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="length"><span class="type-signature"></span>length<span class="signature">(coords)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Returns total length of line</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>coords</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Polyline</span>
|

<span class="param-type">Array.&lt;L.Point></span>
|

<span class="param-type">Array.&lt;L.LatLng></span>


            
            </td>

            

            

            <td class="description last"><p>Set of coordinates</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line113">line 113</a>
    </li></ul></dd>
    

    
    <dt class="tag-tutorial">Tutorials:</dt>
    <dd class="tag-tutorial">
        <ul>
            <li><a href="tutorial-distance-length.html">distance-length</a></li>
        </ul>
    </dd>
    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Total length (pixels for Point, meters for LatLng)</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="locateOnLine"><span class="type-signature"></span>locateOnLine<span class="signature">(map, polyline, latlng)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>Returns a float between 0 and 1 representing the location of the
        closest point on polyline to the given latlng, as a fraction of total line length.
        (opposite of L.GeometryUtil.interpolateOnLine())</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            

            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>Polyline on which the latlng will be search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line526">line 526</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Float between 0 and 1</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="nClosestLayers"><span class="type-signature"></span>nClosestLayers<span class="signature">(map, layers, latlng, n<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"> &rarr; {Array.&lt;object>}</span></h4>

    



<div class="description">
    <p>Returns the n closest layers to latlng among a list of input layers.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>map</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.Map</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Leaflet map to be used for this method</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>layers</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;L.ILayer></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Set of layers</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlng</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The position to search</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>n</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                    &lt;nullable><br>
                

                
                </td>
            

            
                <td class="default">
                
                    layers.length
                
                </td>
            

            <td class="description last"><p>the expected number of output layers.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line324">line 324</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>an array of objects <code>{layer, latlng, distance}</code> or <code>null</code> if the input is invalid (empty list or negative n)</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;object></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="readableDistance"><span class="type-signature"></span>readableDistance<span class="signature">(distance, unit)</span><span class="type-signature"> &rarr; {String}</span></h4>

    



<div class="description">
    <p>Shortcut function for converting distance to readable distance.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>distance</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>distance to be converted</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>unit</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>'metric' or 'imperial'</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line67">line 67</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>in yard or miles</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="reverse"><span class="type-signature"></span>reverse<span class="signature">(polyline)</span><span class="type-signature"> &rarr; {L.PolyLine}</span></h4>

    



<div class="description">
    <p>Returns a clone with reversed coordinates.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>polyline to reverse</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line559">line 559</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>polyline reversed</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">L.PolyLine</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="rotatePoint"><span class="type-signature"></span>rotatePoint<span class="signature">(latlngPoint:, angleDeg:, latlngCenter:)</span><span class="type-signature"> &rarr; {L.LatLng}</span></h4>

    



<div class="description">
    <p>Returns LatLng of rotated point around specified LatLng center.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latlngPoint:</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>point to rotate</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>angleDeg:</code></td>
            

            <td class="type">
            
                
<span class="param-type">double</span>


            
            </td>

            

            

            <td class="description last"><p>angle to rotate in degrees</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>latlngCenter:</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.LatLng</span>


            
            </td>

            

            

            <td class="description last"><p>center of rotation</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line669">line 669</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>rotated point</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">L.LatLng</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="startsAtExtremity"><span class="type-signature"></span>startsAtExtremity<span class="signature">(polyline, other)</span><span class="type-signature"> &rarr; {bool}</span></h4>

    



<div class="description">
    <p>Returns true if first polyline starts where second ends or start.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>polyline</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>First polyline</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type">L.PolyLine</span>


            
            </td>

            

            

            <td class="description last"><p>Second polyline</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="leaflet.geometryutil.js.html">leaflet.geometryutil.js</a>, <a href="leaflet.geometryutil.js.html#line632">line 632</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">bool</span>


    </dd>
</dl>

    



        
    

    

    
</article>

</section>




</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Sep 29 2016 09:47:20 GMT-0400 (EDT) using the Minami theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>